<?php 
/**
 * Content page for menu item: Projects, will list all projects and some meta
 * information.
 * tree->branch->sheet
 * @author embrace.toolkit
 * @version $Id$
 */
require_once($_SERVER["DOCUMENT_ROOT"] . "/ebt/config/config.php");
$ebt = new EmbraceBugTracker($_SERVER["DOCUMENT_ROOT"] . "/ebt/config/");
$arrProjects = $ebt->getProjects();
?>
<h1>Projects(<?= count($arrProjects)?>)</h1>
<p>This is an overview over all projects within the bugtracking. If you
want to see details of a project click it.</p>
<?php 
	foreach($arrProjects as $projectName => $project) {
		?>
		<ul id="<?= $projectName ?>" class="tree">
			<li class="treeItem" node="<?= $projectName ?>"><?= $projectName ?></li>
			<ul class="branch" branch="<?= $projectName ?>">
			<?php 
			foreach($project as $ticketType => $tickets) {
				?>
					<li node="<?= $ticketType ?>"><?= $ticketType ?></li>
					<ul class="tickets" branch="<?= $ticketType ?>">	
					<?php 
					foreach($tickets as $ticket) {
						?>
						<li><?= $ticket ?></li>
						<?php 	
					}					
					?>
					</ul>
				<?php
			}
			?>
			</ul>
		</ul>
		<?php 
	}
?>